#include <iostream>
#include "core/Log.h"
#include "test/test.h"

void test(int argc, char* argv[]) {
//    testJson(argc, argv);
//    testJson2();
//    testString();
    testReflection();
}

// -test=true
void checkExecuteTest(int argc, char* argv[]){
    bool bTest = false;
    if(argv[1]){
        bool bTestArg = StringUtil::startWith(argv[1], "-test=");
        if(bTestArg) {
            std::vector<std::string> array = StringUtil::split(argv[1], "=");
            if (array.size() > 1 && "true" == StringUtil::trim(array[1])) {
                bTest = true;
            }
        }
    }

    if(bTest){
        log_info("***********************************************************")
        log_info("Execute Test Start:")
        test(argc, argv);
        log_info("Execute Test End.")
        log_info("***********************************************************")
    }
}

int main(int argc, char* argv[]){
    std::cerr<<"Hello mRender! version 0.1"<<std::endl;

    checkExecuteTest(argc, argv);

    return 0;
}